﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PlayListSet.UI.ValueConverter
{
    internal class IntToVisibilityHidenValueConverter : System.Windows.Data.IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var v  = (int)value;
            var p = (string)parameter;
            var arr  = p.Split('-');
            for (int i = 0; i < arr.Length; i++)
            {
                if (System.Convert.ToInt32(arr[i]) == v)
                {
                    return System.Windows.Visibility.Visible;
                }
            }
            return System.Windows.Visibility.Hidden;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return 0;
        }
    }
}
